@extends('../manage.layout')
@section('content')
    <!-- Content Header (Page header) -->
    <section class="content-header">
        <h1>
            系统管理
            <small>添加权限</small>
        </h1>
        <ol class="breadcrumb">
            <li><a href="/manage"><i class="fa fa-dashboard"></i>仪表盘</a></li>
            <li class="active">添加权限</li>
        </ol>
    </section>
    <!-- Main content -->
    <section class="content animated fadeInRight">
        <div class="row">
            <div class="col-md-12">
                <!-- general form elements -->
                <div class="box-body table-responsive no-padding">
                    <div class="box box-primary">
                        <!-- /.box-header -->
                        <!-- form start -->
                        <form method="post" action="{{ url('manage/rule/store')}}" enctype=”multipart/form-data”>
                            <input type="hidden" name="_token" value="{{ csrf_token() }}">
                            <div class="box-body">
                                <input type="hidden" name="user_id" value="{{ session('user.id') }}">
                                <div class="form-group">
                                    <label for="role_id">选择角色</label>
                                    <select class="form-control" id="role_id" name="role_id">
                                        <option value="">请选择</option>
                                        @foreach($role as $v)
                                            <option value="{{$v->id}}">{{$v->name}}</option>
                                        @endforeach
                                    </select>
                                </div>
                                <div class="form-group">
                                    <label for="table_id">选择数据表</label>
                                    <select class="form-control" id="table_id" name="table_id">
                                        <option value="">请选择</option>
                                        @foreach($table as $v)
                                            <option value="{{$v->id}}">{{$v->name}}</option>
                                        @endforeach
                                    </select>
                                </div>
                                <div class="form-group">
                                    <label for="view">查看权限</label>
                                    <select class="form-control" name="view" id="view">
                                        <option value="0">否</option>
                                        <option value="1">是</option>
                                    </select>
                                </div>
                                <div class="form-group">
                                    <label for="add">创建权限</label>
                                    <select class="form-control" id="add" name="add">
                                        <option value="0">否</option>
                                        <option value="1">是</option>
                                    </select>
                                </div>
                                <div class="form-group">
                                    <label for="update">修改权限</label>
                                    <select class="form-control" id="update" name="update">
                                        <option value="0">否</option>
                                        <option value="1">是</option>
                                    </select>
                                </div>
                                <div class="form-group">
                                    <label for="delete">删除权限</label>
                                    <select class="form-control" id="delete" name="delete">
                                        <option value="0">否</option>
                                        <option value="1">是</option>
                                    </select>
                                </div>
                            </div>
                            <!-- /.box-body -->
                            <div class="box-footer">
                                <button type="submit" class="btn btn-primary">确定</button>&nbsp;&nbsp;<span class="btn btn-primary" onclick="window.location.href='/manage/rule'">返回</span>
                            </div>
                         </form>
                    </div>
                </div>
            </div>
        </div>
    </section>
    <!-- /.content -->
@endsection
@section('script')
    <script src="/plugin/jquery/jquery-2.2.1.min.js"></script>
    <script src="/plugin/layer-2.4/layer.js"></script>
@endsection

